package com.agileboot.domain.search.db;


import com.agileboot.domain.search.dto.HotSearchDTO;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * (SearchHistory)表数据库访问层
 *
 * @author makejava
 * @since 2023-12-12 11:12:52
 */
@Mapper
public interface SearchHistoryMapper extends BaseMapper<SearchHistory> {
    @Select(" SELECT search_word as searchWord,count(id) num " +
            " FROM `tb_search_history` " +
            " WHERE deleted = 0 " +
            " GROUP BY search_word " +
            " ORDER BY num DESC " +
            " LIMIT 10")
    List<HotSearchDTO> getHotSearchMedicineList();
}

